package com.itheima.boottlias.service.impl;

import com.itheima.boottlias.domain.pojo.EmpLog;
import com.itheima.boottlias.mapper.EmpLogMapper;
import com.itheima.boottlias.service.EmpLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author ghy
 * @version 1.0
 * @since 2025-07-12 11:58
 */
@Service
public class EmpLogServiceImpl implements EmpLogService {

    @Autowired
    private EmpLogMapper empLogMapper;

    @Transactional(
            rollbackFor = Exception.class,
            //自己新开一个事务
            propagation = Propagation.REQUIRES_NEW)
    @Override
    public void save(EmpLog empLog) {
        empLogMapper.insert(empLog);
    }



}
